<!doctype html>
<html class="no-js">
<#include "../../common/header.ftl">
<#include "../../common/common-css.ftl">
<#include "../../common/common-js.ftl"> 
<#include "../../common/upload.ftl">
<script src="${basePath}/js/goods/edit.js?v=201711031455"></script>
<head>
<link rel="stylesheet" href="${basePath}/css/global.css" media="all">
<script type="text/javascript" src="${basePath}/js/jquery.min.js"></script>
<script type="text/javascript" src="${basePath}/js/jquery.easyui.min.1.2.2.js"></script>
<script type="text/javascript">
 var imgUrl = "${imgUrl}";
</script>
<meta charset="UTF-8">
<title>商品编辑页</title>
<style type="text/css">
body{
  		overflow: auto; 
  	}
th {
	width: 100px;
	height: 20px;
}
}
</style>
</head>
<body>
	<div class="admin-content-body">
		<div class="am-g">
			<div class="am-u-sm-12">
				<div>
					<table class="am-table">
						<tr>
							<td>
								<form class="am-form" role="form">
									<div>
									<button  type="button" class="am-btn am-btn-primary" id="btnSaveGoods" name ="btnSaveGoods" onclick="saveGoods()">保存</button>									
									<button  type="button" class="am-btn am-btn-primary" id="close-button">关闭</button>									
									</div>
									<div data-am-widget="tabs" class="am-tabs am-tabs-default" data-am-tabs-noswipe="1">
										<ul class="am-tabs-nav am-cf">
											<li class="am-active"><a href="[data-tab-panel-0]">基本信息</a></li>
											<li class=""><a href="[data-tab-panel-1]">图片</a></li>
											<li class=""><a href="[data-tab-panel-2]">详细描述</a></li>
											<li class=""><a href="[data-tab-panel-3]">尺码信息</a></li>
										</ul>
										<div class="am-tabs-bd">
											<div data-tab-panel-0 class="am-tab-panel am-active" >
												<table class="am-table am-table-bordered">
													<tr>
														<td>商品名称</td>
														<td colspan="3">
															<input type="text" id="goodsName" name="goodsName" placeholder="输入商品名称" value="${goodsVo.goods.goodsName!}" >
														</td>
													</tr>
													<tr>
														<td>商品款号</td>
														<td colspan="3">
															<input name="styleCode" id="styleCode" type="text" placeholder="输入商品款号" value="${goodsVo.goods.styleCode!}" style="width: 150px">
														</td>
													</tr>
													<tr>
														<td>商品标签</td>
														<td >
															<input type="text" id="goodsTags" name="goodsTags" placeholder="输入商品标签" value="${goodsVo.goods.tags!}" style="width: 300px"> 
															<span class="am-form-help">多个标签以英文逗号分隔</span>
														</td>
														<td>最小起订量</td>
														<td >
															<input type="text" id="minimumQuantity"  placeholder="输入最小起订量" value="${goodsVo.goods.minimumQuantity!1}" style="width: 300px"> 
														</td>
													</tr>
													<tr>
														<td>商品品牌</td>
														<td >
															<select class="form-control" data-am-selected="{btnSize: 'sm',maxHeight: 200}" name="selBrand" id="selBrand">
																<option value="" >选择品牌</option>
														        <#list goodsVo.brandItemList! as brands>
														        <option value="${brands.id!}" <#if goodsVo.goods.brandId?? && goodsVo.goods.brandId==brands.id>selected</#if>>${brands.name!}</option>
														        </#list>
															</select>
														</td>
														<td>商品类型</td>
														<td >
														<select data-am-selected="{btnSize: 'sm',maxHeight: 200}" id="selectGoodsType" name="selectGoodsType" style="z-index:70;position: absolute;">
																<option value="">选择分类</option>
														        <#list goodsVo.categoryItemList! as category>
															        <#list category.secondChildList! as secondCategory>
																   		 <#list secondCategory.thirdChildList! as thirdCategory>
																   		 	<#list thirdCategory.fourChildList! as fourCategory>
																   		 		<option value="${fourCategory.id!}" <#if goodsVo.goods.typeId?? && goodsVo.goods.typeId==fourCategory.id>selected</#if>>${category.categoryName!}——${secondCategory.categoryName!}——${thirdCategory.categoryName!}——${fourCategory.name!}</option>
																   		 	</#list>
																   		 </#list>
															        </#list>
														         </#list>
														</select> 
														</td>
													</tr>
													<#if goodsVo.goods.pushId?? && (goodsVo.goods.pushId>0)>
														<tr>
															<td>价格参考</td>
															<td colspan="3">
																<span>成本价：￥${goodsVo.goods.costPrice!}</span>&nbsp;&nbsp;<span>分销供货价：￥${goodsVo.goods.distrSupplyPrice!}</span>&nbsp&nbsp<span>销售价：￥${goodsVo.goods.currentPrice!}</span>
															</td>
														</tr>
													</#if>
													<tr>
														<td>季度</td>
														<td >
															<select class="form-control" data-am-selected="{btnSize: 'sm',maxHeight: 200}" name="selQuarter" id="selQuarter">
																<option value="" >选择季度</option>
														        <option value="1" <#if goodsVo.goods.quarter?? && goodsVo.goods.quarter==1>selected</#if>>春季</option>
														        <option value="2" <#if goodsVo.goods.quarter?? && goodsVo.goods.quarter==2>selected</#if>>夏季</option>
														        <option value="3" <#if goodsVo.goods.quarter?? && goodsVo.goods.quarter==3>selected</#if>>秋季</option>
														        <option value="4" <#if goodsVo.goods.quarter?? && goodsVo.goods.quarter==4>selected</#if>>冬季</option>
															</select>
														</td>
														<td>销售价</td>
														<td >
															<input name="price" type="text" id="price" class="form-control wsa-product-attr-file"
																<#if goodsVo.goods.price??> value="${goodsVo.goods.price?string('#0.00')}"
																<#else> value="0"
																</#if>
																>
														</td>
													</tr>
													<tr>
														<td>商品状态</td>
														<td >
															<div class="am-btn-group clearfix" data-am-button="">
																<label for="is_xianshi" class="am-btn am-btn-default " > 
																<input type="radio" id="is_xianshi" name="status" value="sale"  class="am-btn am-btn-default am-active"
																<#if !(goodsVo.goods.goodsStatus ??)||(goodsVo.goods.goodsStatus=='sale')||(goodsVo.goods.goodsStatus=='push')>checked</#if>>在售
																</label> 
																<label for="is_shenhe" class="am-btn am-btn-default ">
																	<input id="is_shenhe" type="radio" name="status" value="down" class="am-btn am-btn-default am-active"
																	<#if goodsVo.goods.goodsStatus ?? &&(goodsVo.goods.goodsStatus=='down')>checked</#if>>下架
																</label> 
																<label for="is_buxianshi" class="am-btn am-btn-default "> 
																	<input id="is_buxianshi" type="radio" name="status" value="wait" class="am-btn am-btn-default am-active"
																	<#if goodsVo.goods.goodsStatus ?? &&(goodsVo.goods.goodsStatus=='wait')>checked</#if>>待售中
																</label>
															</div>
														</td>
														<td>是否促销商品</td>
														<td >
															<div class="am-btn-group clearfix" data-am-button="">
																<label for="is_cuxiao_no"
																	class="am-btn am-btn-default"> 
																	<input type="radio" id="is_cuxiao_no" name="isSp" value="0"  class="am-btn am-btn-default am-active"
																	<#if (!goodsVo.goods.isSp ??)||(goodsVo.goods.isSp ?? && goodsVo.goods.isSp==0)>checked</#if>>否
																</label> 
																<label for="is_cuxiao_yes"
																	class="am-btn am-btn-default"> <input
																	id="is_cuxiao_yes" type="radio" name="isSp" value="1" class="am-btn am-btn-default am-active"
																	<#if goodsVo.goods.isSp ?? && goodsVo.goods.isSp==1>checked</#if>>是
																</label>
															</div>
														</td>
													</tr>
												</table>
												<div class="div-80"></div>
											</div>
										    <div data-tab-panel-1 class="am-tab-panel">
												<div class="am-form-group">
													<div class="site-upload">
														<#if goodsVo.goods.coverImage??>
													 		<img data-img="${goodsVo.goods.coverImage!}" class ="one-image" src="${imgUrl+goodsVo.goods.coverImage}">
													 	<#else>
													 		<img data-img="" class ="one-image" src="${basePath}/images/default_goods.png" >
													 	</#if>
													  	<div class="site-upbar">
													  		<div class="layui-box ">
													  			<form target="layui-upload-iframe" method="get" key="set-mine" enctype="multipart/form-data" action="#">
													  				 <input type="file" name="files" data-type="one" class="layui-upload-file" >
													  			</form>
													  		 	<!-- <span class="layui-upload-icon"><i class="layui-icon">&#xe608;</i>上传封面图 </span>
													  		 	<p class="am-form-help">封面图片 宽&nbsp;&nbsp;750PX 高&nbsp;&nbsp;750PX</p> -->
													    	</div>
													 	</div>
													  	<p class="am-form-help" style="color:red;font-weight:bold;font-size:17px;">封面图片 宽&nbsp;&nbsp;750PX 高&nbsp;&nbsp;750PX</p>
													</div>
												</div>
												<div class="am-form-group">
													<div  style="width:100%;float:left;">
														<ul class="goods-image">
														 <#list goodsVo.imageList ! as picture >
														 <li><img data-img="${picture.imageUrl!}"  src="${imgUrl+picture.imageUrl}"><a class="closeImage-modal" onclick="deleteImage(this)">x</a></li>
														 </#list>
														</ul>
													</div>
												  	<div  style="float:left;">
												  		<div class="layui-box layui-upload-button">
												  			<form target="layui-upload-iframe" method="get" key="set-mine" enctype="multipart/form-data" action="#">
												  				 <input type="file" name="files" data-type="more" class="layui-upload-file" >
												  			</form>
												  		 	<!-- <span class="layui-upload-icon"><i class="layui-icon">&#xe608;</i>上传商品图 </span> -->
												    	</div>
												 	</div>
												</div>
												<div  style="width:100%;float:left;font-weight:blod;"><p class="am-form-help" style="color:red;font-weight:bold;font-size:17px;">商品图片 宽&nbsp;&nbsp;750PX 高&nbsp;&nbsp;750PX</p></div>
											</div>
											<div data-tab-panel-2 class="am-tab-panel ">
												<fieldset>
													<div class="am-form-group">
														<label for="doc-ipt-email-1">商品简介</label> <input
															type="text" class="" id="smallDesc" name="smallDesc" value="${goodsVo.goods.smallDesc!}"
															placeholder="输入商品简介">
													</div>
													<div class="am-form-group">
														<label for="doc-ipt-email-1">商品材质</label> <input
															type="text" class="" id="material" name="material" value="${goodsVo.goods.material!}"
															placeholder="输入商品材质">
													</div>
													<div class="am-form-group">
														<label for="doc-ipt-email-1">详细描述</label>
														<textarea id="remark" name="remark"
															style="width: 850px; height: 400px;" >${goodsVo.goods.content!}</textarea>
														<p class="am-form-help">商品详情中图片尺寸 宽&nbsp;&nbsp;730PX
															高&nbsp;&nbsp;N-PX</p>
													</div>
												</fieldset>
											</div>
											<div data-tab-panel-3 class="am-tab-panel ">
												<div>
													<button type="button" id="add-content-button" class="btn btn-default j_add_color" onclick="addColorSize()">
														<span class="am-icon-plus"></span>添加颜色尺码
													</button>
												</div>
												<table class="table table-hover" id="color_table">
													<tr>
														<th>颜色名称</th>
														<th>颜色编码</th>
														<th>尺码名称</th>
														<th>尺码编码</th>
														<th>SKU</th>
														<th>库存数量</th>
														<th>操作</th>
													</tr>
													<#list goodsVo.itemList as sizeInfo>
													<tr id="content-tr" class="color-tr">
														<td>
															<input class="am-input-sm" name="itemId" type="hidden" value="${sizeInfo.id!}"/>
															<input class="am-input-sm" name="colorName" type="text" value="${sizeInfo.colorName!}"/>
														</td>
														<td>
															<input class="am-input-sm" name="colorCode" type="text" value="${sizeInfo.colorCode!}"/>
														</td>
														<td>
															<input class="am-input-sm" name="sizeName" type="text" value="${sizeInfo.sizeName!}"/>
														</td>
														<td>
															<input class="am-input-sm" name="sizeCode" type="text" value="${sizeInfo.sizeCode!}"/>
														</td>
														<td>
															<input class="am-input-sm"  name="sku" type="text" value="${sizeInfo.sku!}"/>
														</td>
														<td>
															<input class="am-input-sm"  name="stockedQuantity" type="text" value="${sizeInfo.stockedQuantity!}"/>
														</td>
														<td>
															<button class="btn btn-default j_delete_sizes" onclick ="deleteTr(this)">
																<span class="am-icon-trash-o"></span> 删除
															</button>
													   </td>
													</tr>
													</#list>
												</table>
												<input type="hidden" name="goodsId" value="${goodsVo.goods.id!}"/>
											</div>
										</div>
									</div>
								</form>
							</td>
						</tr>
					</table>
				</div>
			</div>
		</div>
		<!-- content end -->
	</div>
</body>
</html>
